package com.carboncntr.util;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.carboncntr.helper.HistoryHelper;

public class DeleteHistoryWebService extends HttpServlet {
	public void init() throws ServletException{
		super.init();
	}
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) {
		doPost(request, response);
	}
	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) {
		Integer historyId = Integer.parseInt(request.getParameter("historyId"));
		HistoryHelper.deleteHistory(historyId);
		try {
			response.getWriter().write("success");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
